//2019/1/14

#include <iostream>
#include <string>

using namespace std ;
#include "dlt645.h"

ostream& operator << ( ostream& ost , CommunAddrFrameM2S& frame)
{
	ost<<"startMark1:0x"<<hex<< (int)frame.startMark1 << endl ;
	ost<<"addr6[6]:0x"  ;
	for ( int i = 0 ; i < 6 ; i ++ )
		ost << (int)frame.addr6[i] ;
	ost << endl ;
    ost<<"startMark2:0x"  << (int)frame.startMark2 << endl ;
    ost<<"controlCode:0x" << (int)frame.controlCode << endl ;
    ost<<"dataLen: " << (int)frame.dataLen << endl ;
    ost<<"data[256]:0x" ;
	for ( int i = 0 ; i <= (int)frame.dataLen ; i ++ )
		ost << (int)frame.dataUn.data[i]   ;
	ost << endl ;
	ost<<"cs:0x" << (int) frame.cs << endl ;
    ost<<"endMark:0x" <<(int) frame.endMark << endl ;
	return ost ;
}

//test
int main()
{
	ControlCode cc ;
	cout <<"cc.dircMaskM2S = " << cc.dircMaskM2S << endl ;
	cout <<"cc.functioncode = " << cc.functioncode << endl ;
	CommunAddrFrameM2S  cafm2s ;
	cout << " cafm2s" << endl  << cafm2s ;
	return 0 ;
}

